package com.flashcash.solu.harvester;

public class ServerTimeUtils {

    /**在API请求中，获取到服务器时间
     * deltTime = serverTime - localTime
     * 使用时，由本地时间推出相对应的服务器时间
     * serverTime = localTime + deltTime;
     * */
    private static long deltTime = 0;
    public static long getServerTime(){
        long localTime = System.currentTimeMillis();
        long serverTime = localTime + deltTime;
        return serverTime;
    }

    public static void saveServerLocalTimeDelta(long delt){
        deltTime = delt;
    }
}
